# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gnome-podcasts
pkgver=0.5.1
pkgrel=0
pkgdesc="Podcast app for GNOME"
url="https://wiki.gnome.org/Apps/Podcasts"
# x86 blocked by crashing Rust
# armv7 blocked by failing test
# s390x and riscv64 blocked by rust/cargo
arch="all !s390x !armv7 !riscv64"
license="GPL-3.0-or-later"
depends="gst-plugins-good"
makedepends="meson gtk+3.0-dev gstreamer-dev libhandy1-dev sqlite-dev openssl1.1-compat-dev
	dbus-dev gst-plugins-base-dev gst-plugins-bad-dev cargo bash"
checkdepends="desktop-file-utils appstream-glib xvfb-run"
options="!check" # needs the thing to be installed first
subpackages="$pkgname-lang"
source="https://gitlab.gnome.org/World/podcasts/uploads/de438a4d62196bddd134bb155a812fe1/gnome-podcasts-$pkgver.tar.xz
	meson-0.60.patch
	"

prepare() {
	default_prepare

	sed 's| /usr/bin/sh|/bin/sh|' -i scripts/test.sh
}

build() {
	abuild-meson . output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	xvfb-run meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
7b50112fc1f7bbbec1b916ba4490738752af603d5ddf3e0621dc18b6bacb488ba557e895529b940b9e039870aa5577550cf807c40011187d7d41c326a46d2803  gnome-podcasts-0.5.1.tar.xz
4c75425d626de3a35616b6a9e89538b5d89dc920bc94b5cf73c62ae8985e67159778069fa2e3363ea3a5ae3e423cc8df274d09361c6bcaa3ea678f1345faae65  meson-0.60.patch
"
